<?php
@$admZC=$_REQUEST['adm'];
@$telZC=$_REQUEST['tel'];
@$yzmZC=$_REQUEST['yz'];
/*帐号验证*/
if(!empty($admZC)){
    $pdo=new PDO('mysql:dbname=shuju;charset=utf8','root');
    $use=$pdo->prepare('select adm from customerLogin where adm=:aa');
    $use->execute(array('aa'=>$admZC));
    $data=$use->fetchAll(PDO::FETCH_NAMED);
    if(!empty($data)){
        echo "false";exit();
    }else{
        echo "true";exit();
    }
}
/*电话验证*/
if(!empty($telZC)) {
    $pdo = new PDO('mysql:dbname=shuju;charset=utf8', 'root');
    $use = $pdo->prepare('select tel from customerLogin where tel=:aa');
    $use->execute(array('aa' => $telZC));
    $data = $use->fetchAll(PDO::FETCH_NAMED);
    if (!empty($data)) {
        echo "false";exit();
    } else {
        echo "true";exit();
    }
}
//验证码验证
if(!empty($yzmZC)){
    session_start();
    @$yzm=$_SESSION["yzm"];
    if($yzmZC==$yzm){
        echo "true";exit();
    }else{
        echo "false";exit();
    }
}
/*注册*/
?>
<html>
<head></head>
<body>
<?php
@$adm=$_REQUEST['admin2'];@$pwd=$_REQUEST['password2'];@$tel=$_REQUEST['tel2'];
@$named=$_REQUEST['xingming2'];@$idcard=$_REQUEST['idcard2'];@$QQ=$_REQUEST['QQ2'];
if(!empty($adm) && !empty($pwd)){
    $pdo = new PDO('mysql:dbname=shuju;charset=utf8', 'root');
    $use = $pdo->prepare('insert into customerLogin(adm,pwd,tel,named,idcard,QQ) values(:aa,:bb,:cc,:dd,:ee,:ff);');
    $isok=$use->execute(array('aa' =>$adm,'bb'=>$pwd,'cc'=>$tel,'dd'=>$named,'ee'=>$idcard,'ff'=>$QQ));
    if($isok){
        ?>
        <div style="font-size: 200%;text-align: center;position: relative;top: 50px;color: rgba(34, 120, 24, 1);">注册成功,稍后为你跳转</div>
        <?php
        header("Refresh:2;url=../index.php");
    }else{
        ?>
        <div style="font-size: 200%;text-align: center;position: relative;top: 50px;color: rgba(34, 120, 24, 1);">注册失败，请重新注册</div>
        <?php
        header("Refresh:2;url=../index.php");
    }
}
?>
</body>
</html>
